Documentation for Users  1.1.0
Perception Toolbox for Virtual Reality (PTVR) Manual
Interactions between Events and Callbacks

Subsections

Introduction

When you create a visual Scene, you can also add an Interaction to this scene.
For example, you can decide that pressing the keyboard's "q" key while this scene is displayed will allow you to instantaneously quit the PTVR.exe program ( see demo here ).

An Interaction requires a list of Events and a list of Callbacks.

In the example above, the Event would be triggered by "q" press and this Event would then call the Quit Callback ( see demo here ). This interaction is represented by highlighted colors in the figure below.

To add an Interaction to a visualScene, use the function .AddInteraction() as in the following line of code:

my_scene.AddInteraction (Events = [my_events], Callbacks = [my_callbacks])

[my_events] is a list of ONE or SEVERAL Events

[my_callbacks] is a list of ONE or SEVERAL Callbacks

Note that this syntax clearly shows that an interaction is specific to a given scene !

The figure below shows some of the Events and Callbacks that you can use to create one or multiple interactions for a given scene (the Events and the Callbacks are respectively in yellow and blue).